﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BesAsm.Emgaats.Core.Commands
{
  public class ModelSaveCommand : SingleCommand
  {
    private Mediator _mediator;
    private ModelIO _modelIO = new ModelIO();

    public ModelSaveCommand()
    {      
    }

    #region IEmgaatsExtensionCommand Members

    public override void Execute()
    {
      base.Execute();      
      _modelIO.Save(Mediator.Model);
      string controlMxd = Mediator.Model.GetPathIfSet(ModelPathComponent.ControlMXD);
      ArcMap.Application.SaveDocument(controlMxd);
    }

    public override void Undo()
    {
      throw new NotImplementedException();
    }

    public override string Name
    {
      get { return "Save model"; }
    }

    public override string Description
    {
      get { return "Save model"; }
    }

    #endregion
  }
}
